package com.dlb.andorid.activity;

import android.widget.TextView;

import com.dlb.andorid.App;
import com.dlb.andorid.R;
import com.kwan.xframe.mvp.presenter.BasePresenter;
import com.kwan.xframe.mvp.view.activity.BaseCommonActivity;

public class AccountActivity extends BaseCommonActivity {

	@Override
	protected BasePresenter getBasePresenter() {
		return null;
	}

	@Override
	protected void initData() {

	}

	@Override
	protected void initViews() {
		super.initViews();

		if(App.mUserInfo!=null) {

			((TextView) findViewById(R.id.tv_point)).setText(""+App.mUserInfo.getIntegral_num());
			((TextView) findViewById(R.id.tv_coin)).setText(""+App.mUserInfo.getGold_coin());
			((TextView) findViewById(R.id.tv_money)).setText(""+App.mUserInfo.getBalance_num());

			((TextView) findViewById(R.id.tv_nick_name)).setText(App.mUserInfo.getNickname());
			String str = App.mUserInfo.getPhone();
			if (str.length() == 11) {
				String p = str.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
				((TextView) findViewById(R.id.tv_phone)).setText(p);
			} else {
				((TextView) findViewById(R.id.tv_phone)).setText(str);
			}
		}
	}

	@Override
	protected int getTopViewId() {
		return 0;
	}

	@Override
	protected int getMainViewId() {
		return R.layout.activity_account;
	}

	@Override
	protected int getBottomViewId() {
		return 0;
	}

	@Override
	protected String getTitleTxt() {
		return "账号管理";
	}

	@Override
	public String getPageName() {
		return null;
	}
}
